﻿using ContactSMS.Domain.Entity;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace ContactSMS.Infrastructure.Configs
{
    internal class MessageConfig : IEntityTypeConfiguration<Message>
    {
        public void Configure(EntityTypeBuilder<Message> builder)
        {
            builder.ToTable($"T_{nameof(Message)}", t => t.HasComment("短信表"));
            builder.HasKey(t => t.Id);
            builder.Property(t => t.MessageSessionId).HasDefaultValue(0).HasComment("短信会话ID");
            builder.Property(t => t.Desc).HasComment("消息内容");
            builder.Property(t => t.IsRead).HasDefaultValue(0).HasComment("是否已读");
            builder.Property(t => t.ContactId).HasComment("联系人id");
            builder.Property(t => t.CreatTime).HasComment("创建时间");
            builder.Property(t => t.UpdateTime).HasComment("更新时间");
        }
    }
}
